<?php

/*
  In this class we instantiate an SQL Connection object. Connection details are assinged to
  object variabes so that they can be used when connecting to the database. The two main
  functions are conn() and disc(). They are for connecting and disconnecting to the SQL database.
 */

require_once("./connect.php");


$ini=parse_ini_file('config.ini',false);

if(mysql_select_db($ini['dbName']))
{
    $q="Select Max(id) as id From cards ;";
    $r = mysql_query($q);
while($vname = mysql_fetch_array($r)){
$id = $vname['id'];
    //echo($id);
}

$j="Select json From cards Where id='" . $id . "';";
    $r = mysql_query($j);
while($vname = mysql_fetch_array($r)){
$data = $vname['json'];
echo($data);

return($data);    
}



}

?>